package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
//新增套餐时添加菜品
    @Insert("insert into setmeal_dish (id, setmeal_id, dish_id, name, price, copies) VALUES (#{id}, #{setmealId}, #{dishId}, #{name}, #{price}, #{copies})")
    void addDish(SetmealDish setmealDish);
//删除套餐中的菜品
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteDish(Long id);
//根据套餐id查询套餐菜品
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> selectById(Long id);


}
